﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace AutoLoL.Playground
{
    /// <summary>
    /// Interaction logic for InibinCompareWindow.xaml
    /// </summary>
    public partial class InibinCompareWindow : Window
    {
        public InibinCompareWindow()
        {
            InitializeComponent();
        }

        public void CompareData(List<InibinData> datas)
        {
            List<uint> keysAdded = new List<uint>();

            foreach (InibinData data in datas)
            {
                foreach (uint key in data.Keys)
                {
                    if (!keysAdded.Contains(key))
                    {
                        var col = new DataGridTextColumn();
                        col.Header = key;
                        col.Binding = new Binding("[" + key + "]");
                        CompareDataGrid.Columns.Add(col);

                        keysAdded.Add(key);
                    }
                }
            }

            CompareDataGrid.ItemsSource = datas;
        }
    }
}
